package com.xydtech.ecard.product.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xydtech.ecard.product.mapper.EcardApiPrdInfoMapper;
import com.xydtech.ecard.product.domain.EcardApiPrdInfo;
import com.xydtech.ecard.product.service.IEcardApiPrdInfoService;

/**
 * 电子名片产品配置Service业务层处理
 * 
 * @author Daniel
 * @date 2021-09-06
 */
@Service
public class EcardApiPrdInfoServiceImpl implements IEcardApiPrdInfoService 
{
    @Autowired
    private EcardApiPrdInfoMapper ecardApiPrdInfoMapper;

    /**
     * 电子名片-产品配置-根据客户经理ID获取优选产品
     * @param userId
     * @param deptId
     * @return
     */
    @Override
    public List<EcardApiPrdInfo> getPrdListByUser(String userId, Long deptId) {
        return ecardApiPrdInfoMapper.getPrdListByUser(userId, deptId);
    }

    /**
     * 根据产品ID获取产品详情
     * @param prdId
     * @return
     */
    @Override
    public EcardApiPrdInfo getPrdDetailByPrdId(Long prdId, String registId){
        return ecardApiPrdInfoMapper.getPrdDetailByPrdId(prdId, registId);
    }

    /**
     * 电子名片-工作室-新增产品分享记录
     * @param prdId
     * @param custmanagerId
     * @return
     */
    @Override
    public int insertSharePrdInfo(String currentUserId, Long prdId, Long custmanagerId){
        return ecardApiPrdInfoMapper.insertSharePrdInfo(currentUserId, prdId, custmanagerId);
    }
}
